myApp.controller('userManageController', function ($scope, $http) {
    $scope.userSave = function () {
        if ($scope.pg.name == null || $scope.pg.name == undefined ||
            $scope.pg.description == null || $scope.pg.description == undefined) {
            alert('用户名称或描述不能为空！！！');
            return false;
        } else {
            $http({
                url: "/insertUser",
                method: "post",
                dataType: 'json',
                contentType: 'application/json',
                data: $scope.pg
            })
                .success(function (data) {
                    alert(data.message);
                    window.location.reload(false);
                });
        }


    }
});
